package top.huxy.boot.controller.admin;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.huxy.boot.annotation.RequestRemake;
import top.huxy.boot.model.dto.Pager;
import top.huxy.boot.model.dto.Query;
import top.huxy.boot.service.ExceptionLogService;
import top.huxy.boot.util.obj.Result;

/**
 * @Classname ExceptionLogController
 * @Description ExceptionLogController
 * @Date 2021/9/19 15:48
 * @Created by huxy
 */
@RestController
@RequestMapping("/admin/exceptionLog")
public class ExceptionLogController {

    ExceptionLogService exceptionLogService;

    public ExceptionLogController(ExceptionLogService exceptionLogService) {
        this.exceptionLogService = exceptionLogService;
    }

    @GetMapping("/getExceptionLogList")
    @RequestRemake("获取异常日志")
    public Result getExceptionLogList(Pager pager, Query query){
        return Result.success(exceptionLogService.getExceptionLogList(pager,query));
    }

    @GetMapping("/getExceptionLogExceptNames")
    @RequestRemake("获取所有异常名")
    public Result getExceptionLogExceptNames(){
        return Result.success(exceptionLogService.getExceptionLogExceptNames());
    }
}
